package com.bingwang.sourcelearn.qualifier.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @author WangBing
 * @date 2024/6/16 22:28
 */
@Service
public class DataQueryService {

    @Autowired
//    @Qualifier("mysqlDataService")
    private DataService mysqlDataService;

    @Autowired
//    @Qualifier("postgresDataService")
    private DataService postgresDataService;

    public void loadData(String type) {
        if ("mysql".equals(type)) {
            mysqlDataService.loadData();
        } else {
            postgresDataService.loadData();
        }
    }
}
